var e = require;
var t = module;
var n = a(e("RecorderMgr")),
o = a(e("EndMgr")),
i = a(e("SoundMgr"));
function a(e) {
    return e && e.__esModule ? e: {
        default: e
    }
}
window.JailSceneContent = {
    Instance: null
};
var r = e("LevelManager");
cc.Class({
    extends: cc.Component,
    properties: {
        CameraTargetNode: cc.Node,
        ControllerJailPrefabs: {
            type: cc.Node,
            default: []
        },
        SkeletonObjects: {
            type: [cc.Node],
            default: []
        }
    },
    onLoad: function() {
        JailSceneContent.Instance = this
    },
    Show: function(e) {
        LevelManager.Instance.AllowAvatarControllerMove = !1;
        i.default.Instance.playSoundClip(AssetManager.Instance.AudioClips[8]);
        for (var t = 0; t < this.SkeletonObjects.length; t++) this.SkeletonObjects[t].active = !1;
        var a = Math.round(Math.random() * (this.SkeletonObjects.length - 1));
        this.SkeletonObjects[a] && (this.SkeletonObjects[a].active = !0);
        for (t = 0; t < this.ControllerJailPrefabs.length; t++) null != this.ControllerJailPrefabs[t] && (this.ControllerJailPrefabs[t].active = !1);
        this.unscheduleAllCallbacks();
        this.ControllerJailPrefabs[e].active = !0;
        this.scheduleOnce(function() {
            null != this.ControllerJailPrefabs[e] && this.ControllerJailPrefabs[e].getComponent(cc.Animation).play("ControllerJailPrefab")
        },
        .3);
        this.node.position = cc.v2(LevelManager.Instance.SceneMainCameraNode.x, this.node.y);
        var s = LevelManager.Instance.SceneMainCameraNode.position,
        c = cc.moveTo(.8, cc.v2(this.node.x, this.CameraTargetNode.y)),
        l = cc.delayTime(2.2),
        d = cc.moveTo(.8, s),
        h = cc.callFunc(function() {
            LevelManager.Instance.SceneMainAudioSource.play();
            LevelManager.Instance.GameCurrentOperationScene = r.GameSceneBlockType.Lobby;
            LevelManager.Instance.AttackProgressBar.progress = 0;
            LevelManager.Instance.AllowAvatarControllerMove = !0;
            LevelManager.Instance.GameAllowOperation = !0;
            null != NPCKingController.Instance ? NPCKingController.Instance.onJailSceneFinish() : null != KingController.Instance && KingController.Instance.onJailSceneFinish();
            if (SDK.Mgr.Inst.curChannel == SDK.Define.Channel.oppo || SDK.Mgr.Inst.curChannel == SDK.Define.Channel.vivo || SDK.Mgr.Inst.curChannel == SDK.Define.Channel.tt) {
                o.default.Instance.showFail();
                SDK.Mgr.Inst.curChannel == SDK.Define.Channel.tt && n.default.Instance.stopRecord()
            } else {
                SDK.Mgr.Inst.curChannel == SDK.Define.Channel.tt && n.default.Instance.stopRecord();
                n.default.Instance.showSharePanel()
            }
        }.bind(this)),
        u = cc.sequence([c, l, d, h]);
        CameraManager.Instance.node.runAction(u)
    }
})